package com.iflytek.yly.jetpackdemo.databinding;

import android.os.Bundle;
import android.widget.TextView;

import androidx.appcompat.app.AppCompatActivity;

import com.iflytek.yly.jetpackdemo.R;

public class SimpleTextViewDemo1Activity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_databinding_demo1);

        TextView tvTitle = findViewById(R.id.tvTitle);
        TextView tvAuthor= findViewById(R.id.tvAuthor);
        TextView tvRating = findViewById(R.id.tvRating);

        Book book = new Book("JetPack 简明介绍","小王");
        book.rating = 5;

        tvTitle.setText(book.title);
        tvAuthor.setText(book.author);
        tvRating.setText(String.valueOf(book.rating));



    }
}